package com.guigu.tms.aggregation.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.guigu.tms.aggregation.service.ITransportLineService;
import com.guigu.tms.commons.aggregation.entity.TransportLine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 线路表 前端控制器
 * </p>
 *
 * @author wj
 * @since 2022-10-21
 */
@RestController
@RequestMapping("/transportLine")
public class TransportLineController {

    @Autowired
    private ITransportLineService transportLineService;

    @GetMapping("getTransPortLine")
    public List<TransportLine> getTransPortLine(TransportLine transportLine){
        QueryWrapper<TransportLine> queryWrapper = new QueryWrapper<>(transportLine);
        return transportLineService.list(queryWrapper);
    }

    @GetMapping("getTransportLineById")
    public TransportLine getTransportLineById(String id){
        return transportLineService.getById(id);
    }
}
